< previous page page_427 next page >

Page 427
Now, add the code from Listing 11.8 to the Form_Resize event. This code allows users to resize the graph by resizing the form.
Type.gifListing 11.8. Adding code to the Form_Resize event.
Private Sub Form_Resize()
    '
    ' make graph fill the form
    '
    Graph1.Left = 1
    Graph1.Top = 1
    Graph1.Width = Me.ScaleWidth
    Graph1.Height = Me.ScaleHeight
    '
End Sub
The code in Listing 11.9 goes in the mnuFileItem_Click event. This code is executed each time the user selects one of the File menu items. The Index value returns the item number selected by the user. You code the CopyGraph and SaveGraph methods in just a moment.
Type.gifListing 11.9. Coding the mnuFileItem_Click event.
Private Sub mnuFileItem_Click(Index As Integer)
    '
    ' handle file menu selections
    '
    Select Case Index
        Case 0 ' save
            GraphSave
        Case 1 ' copy
            GraphCopy
        Case 2 ' separator
            ' no action
        Case 3 ' print
            Me.PrintForm
        Case 4 ' printer setup
            CommonDialog1.ShowPrinter
        Case 5 ' separator
            ' no action
        Case 6 ' exit
            Unload Me
    End Select
    '
End Sub

 
< previous page page_427 next page >

If you like this book, buy it!